#import "RNSearchResultsTable.h"
#import "RNConstants.h"

static NSColor *backgroundColor;

@implementation RNSearchResultsTable

+(void)initialize {
    backgroundColor = [NSColor colorWithCalibratedWhite:0.8 alpha:0.4];
}

- (void)highlightSelectionInClipRect:(NSRect)clipRect {
    // No-op.  Highlighting is done in the custom cells
}

-(CGFloat)rowHeight {
    return RNAddListItemCellHeight;
}

-(BOOL)acceptsFirstResponder {
    return NO;
}

- (void)drawRow:(NSInteger)rowIndex clipRect:(NSRect)clipRect {
    if ((rowIndex % 2) == 1) {
        NSRect backgroundRect = NSInsetRect([self rectOfRow:rowIndex], 4.0f, 0.0f);
        NSBezierPath *highlightPath = [NSBezierPath bezierPathWithRoundedRect:backgroundRect xRadius:RNDetailViewCellCornerRadius yRadius:RNDetailViewCellCornerRadius];
        [backgroundColor setFill];
        [highlightPath fill];
    }
    [super drawRow:rowIndex clipRect:clipRect];
}

@end
